#ifndef __CRITICAL_SECTION_H__
#define __CRITICAL_SECTION_H__

#ifdef __NIOS2__

#include "sys/alt_irq.h"

#define critical_section_enter()    alt_irq_context context; context = alt_irq_disable_all()
#define critical_section_leave()    alt_irq_enable_all(context)

#else

#define critical_section_enter()
#define critical_section_leave()

#endif

#endif
